
//v-bind:src="hostservlet+'img/'+imginfo.imgid+'.jpg'" width="100px" height="370px"
let hostservlet="http://localhost:8080/projectfirst/"
$.ajaxSetup({
    async:false,
    xhrFields: {
        withCredentials: true
    }
})

$(function (data) {
//alert(location.search.substr(location.search.indexOf('=')+1))
    let productid=location.search.substr(location.search.indexOf('=')+1)

    let app=new Vue({
        el:"#app",
        data:{
            pinfo:getproductinfo(productid),

            imgall:getimginfo(productid),
            hostservlet:hostservlet
        }
    })
})


function getproductinfo(productid) {
    let temp;
    $.post(hostservlet+"productservlet",{"type":"selectbyid","id":productid},function (data) {
        temp=data
    },"json")
    return temp
}

function getimginfo(productid) {
    let temp;
    $.post(hostservlet+"productservlet",{"type":"selectimgallbyid","productid":productid},function (data) {
        temp=data
    },"json")
    return temp
}


